package mysql

import "gorm.io/gorm"

type Order struct { //订单表
	gorm.Model
	UserId     int     `gorm:"type:int(11);not null;comment:'用户id'"`
	GoodsId    int     `gorm:"type:int(11);not null;comment:'商品id'"`
	OrderSn    string  `gorm:"type:varchar(100);not null;comment:'订单编号'"`
	GoodsName  string  `gorm:"type:varchar(30);not null;comment:'商品名称'"`
	GoodsCover string  `gorm:"type:varchar(255);not null;comment:'商品封面'"`
	Status     int8    `gorm:"tinyint;default:1;comment:支付状态:0-待支付,1-已支付,2-已取消,3-已完成''"`
	Amount     float64 `gorm:"type:decimal(10,2);not null;comment:'总金额'"`
	PayType    int8    `gorm:"type:tinyint;default:1;comment:支付方式:0-微信,1-支付宝"`
}
type OrderGoods struct { //订单商品表
	gorm.Model
	GoodsName  string  `gorm:"type:varchar(30);not null;comment:'商品名称'"`
	GoodsCover string  `gorm:"type:varchar(255);not null;comment:'商品封面'"`
	GoodsNum   int     `gorm:"type:int(11);not null;comment:'商品数量'"`
	GoodsPrice float64 `gorm:"type:decimal(10,2);not null;comment:'商品数量'"`
}
type User struct {
	gorm.Model
	UserName string `gorm:"type:varchar(30);not null;comment:'用户名'"`
	Checked  int8   `gorm:"type:tinyint;default:1;comment:'用户状态:0-不正常,1-正常'"`
}
